package ee.homework.seventh;

public class Node {

	private int key;
	private Color color;
	private int distance;
	private Node predecessor;

	enum Color {
		WHITE, GRAY, BLACK;
	}

	public Node(int key) {
		this.setKey(key);
		this.setColor(Color.WHITE);
		this.setDistance(Integer.MAX_VALUE);
		this.setPredecessor(null);
	}

	public void setKey(int key) {
		this.key = key;
	}

	public int getKey() {
		return key;
	}

	public void setColor(Color color) {
		this.color = color;
	}

	public Color getColor() {
		return color;
	}

	public void setDistance(int distance) {
		this.distance = distance;
	}

	public int getDistance() {
		return distance;
	}

	public void setPredecessor(Node predecessor) {
		this.predecessor = predecessor;
	}

	public Node getPredecessor() {
		return predecessor;
	}

	@Override
	public String toString() {
		return String.valueOf(getKey());
	}
}
